import Vue from 'vue'
import VueRouter from 'vue-router'

const importPage = (view) => () => import(`./page/${view}.vue`)
Vue.use(VueRouter)

const routers = [
  {
    path: '/',
    name: 'index',
    component: importPage('index'),
  },
  {
    path: '/register',
    name: 'register',
    component: importPage('register'),
  },
  {
    path: '/car_buy_detail',
    name: 'car_buy_detail',
    component: importPage('detail/car_buy_detail'),
  },
  {
    path: '/car_sale_detail',
    name: 'car_sale_detail',
    component: importPage('detail/car_sale_detail'),
  },
  {
    path: '/car_sale_detail',
    name: 'car_sale_detail',
    component: importPage('detail/car_sale_detail'),
  },
  {
    path: '/car_zu_detail',
    name: 'car_zu_detail',
    component: importPage('detail/car_zu_detail'),
  },
  {
    path: '/car_qiuzu_detail',
    name: 'car_qiuzu_detail',
    component: importPage('detail/car_qiuzu_detail'),
  },
  {
    path: '/house_buy_detail',
    name: 'house_buy_detail',
    component: importPage('detail/house_buy_detail'),
  },
  {
    path: '/house_sale_detail',
    name: 'house_sale_detail',
    component: importPage('detail/house_sale_detail'),
  },
  {
    path: '/house_zu_detail',
    name: 'house_zu_detail',
    component: importPage('detail/house_zu_detail'),
  },
  {
    path: '/house_qiuzu_detail',
    name: 'house_qiuzu_detail',
    component: importPage('detail/house_qiuzu_detail'),
  },
  {
    path: '/add_car_sale',
    name: 'add_car_sale',
    component: importPage('add/add_car_sale'),
  },
  {
    path: '/add_car_buy',
    name: 'add_car_buy',
    component: importPage('add/add_car_buy'),
  },
  {
    path: '/add_car_zu',
    name: 'add_car_zu',
    component: importPage('add/add_car_zu'),
  },
  {
    path: '/add_car_qiuzu',
    name: 'add_car_qiuzu',
    component: importPage('add/add_car_qiuzu'),
  },
  {
    path: '/add_house_buy',
    name: 'add_house_buy',
    component: importPage('add/add_house_buy'),
  },
  {
    path: '/add_house_qiuzu',
    name: 'add_house_qiuzu',
    component: importPage('add/add_house_qiuzu'),
  },
  {
    path: '/add_house_zu',
    name: 'add_house_zu',
    component: importPage('add/add_house_zu'),
  },
  {
    path: '/add_house_sell',
    name: 'add_house_sell',
    component: importPage('add/add_house_sell'),
  },
  {
    path: '/update_car_buy',
    name: 'update_car_buy',
    component: importPage('update/update_car_buy'),
  },
  {
    path: '/update_car_sale',
    name: 'update_car_sale',
    component: importPage('update/update_car_sale'),
  },
  {
    path: '/update_car_zu',
    name: 'update_car_zu',
    component: importPage('update/update_car_zu'),
  },
  {
    path: '/update_car_qiuzu',
    name: 'update_car_qiuzu',
    component: importPage('update/update_car_qiuzu'),
  },
  {
    path: '/update_house_buy',
    name: 'update_house_buy',
    component: importPage('update/update_house_buy'),
  },
  {
    path: '/update_house_qiuzu',
    name: 'update_house_qiuzu',
    component: importPage('update/update_house_qiuzu'),
  },
  {
    path: '/update_house_zu',
    name: 'update_house_zu',
    component: importPage('update/update_house_zu'),
  },
  {
    path: '/update_house_sale',
    name: 'update_house_sale',
    component: importPage('update/update_house_sale'),
  },
  {
  path: '/user_center_order',
  name: 'user_center_order',
  component: importPage('user_center/user_center_order'),
  },
  {
    path: '/user_center_car_qiuzu',
    name: 'user_center_car_qiuzu',
    component: importPage('user_center/user_center_car_qiuzu'),
  },
  {
    path: '/user_center_car_zu',
    name: 'user_center_car_zu',
    component: importPage('user_center/user_center_car_zu'),
  },
  {
    path: '/user_center_car_sale',
    name: 'user_center_car_sale',
    component: importPage('user_center/user_center_car_sale'),
  },
  {
    path: '/user_center_car_buy',
    name: 'user_center_car_buy',
    component: importPage('user_center/user_center_car_buy'),
  },
  {
    path: '/user_center_fang_qiuzu',
    name: 'user_center_fang_qiuzu',
    component: importPage('user_center/user_center_fang_qiuzu'),
  },
  {
    path: '/user_center_fang_zu',
    name: 'user_center_fang_zu',
    component: importPage('user_center/user_center_fang_zu'),
  },
  {
    path: '/user_center_fang_sale',
    name: 'user_center_fang_sale',
    component: importPage('user_center/user_center_fang_sale'),
  },
  {
    path: '/user_center_fang_buy',
    name: 'user_center_fang_buy',
    component: importPage('user_center/user_center_fang_buy'),
  },
  {
    path: '/user_center',
    name: 'user_center',
    component: importPage('user_center'),
  },
  {
    path: '/fang_buy',
    name: 'fang_buy',
    component: importPage('more/fang_buy'),
  },
  {
    path: '/fang_sale',
    name: 'fang_sale',
    component: importPage('more/fang_sale'),
  },
  {
    path: '/fang_zu',
    name: 'fang_zu',
    component: importPage('more/fang_zu'),
  },
  {
    path: '/fang_qiuzu',
    name: 'fang_qiuzu',
    component: importPage('more/fang_qiuzu'),
  },
  {
    path: '/car_buy',
    name: 'car_buy',
    component: importPage('more/car_buy'),
  },
  {
    path: '/car_sale',
    name: 'car_sale',
    component: importPage('more/car_sale'),
  },
  {
    path: '/car_zu',
    name: 'car_zu',
    component: importPage('more/car_zu'),
  },
  {
    path: '/car_qiuzu',
    name: 'car_qiuzu',
    component: importPage('more/car_qiuzu'),
  },
  {
    path: '/test_pay',
    name: 'test_pay',
    component: importPage('testpay/test_pay'),
  },
  {
    path: '/test_pay',
    name: 'yanzhengma',
    component: importPage('testpay/yanzhengma'),
  },
]
const router = new VueRouter({

  routers,
})
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err)
}

export default routers
